package jsu.weizixuan.likesystem.service;

import jakarta.servlet.http.HttpServletRequest;
import jsu.weizixuan.likesystem.model.pojo.DoThumbRequest;
import jsu.weizixuan.likesystem.model.pojo.Thumb;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* @author 魏子轩
* @description 针对表【thumb】的数据库操作Service
* @createDate 2025-09-19 20:48:31
*/
public interface ThumbService extends IService<Thumb> {

    /**
     * 点赞
     * @param doThumbRequest
     * @param request
     * @return {@link Boolean }
     */
    Boolean doThumb(DoThumbRequest doThumbRequest, HttpServletRequest request);

    /**
     * 取消点赞
     * @param doThumbRequest
     * @param request
     * @return {@link Boolean }
     */
    Boolean undoThumb(DoThumbRequest doThumbRequest, HttpServletRequest request);

    /**
     * 判断用户是否已经点赞
     * @param blogId
     * @param userId
     * @return
     */
    Boolean hasThumb(Long blogId, Long userId);

    /**
     * 获取点赞数
     * @param blogId
     * @return
     */
    Long getThumbCount(Long blogId,HttpServletRequest  request);

}
